import { useState, useEffect } from "react";
import { getChannelApi } from "@/apis/article";
function useChannel() {
  const [channelList, setChannelList] = useState();

  useEffect(() => {
    const getChannelList = async () => {
      const res = await getChannelApi();
      //  console.log(res.data.data,77)
      setChannelList(res.data.data.channels);
    };
    getChannelList();
  }, []);
  return {
    channelList,
  };
}

export { useChannel };
